﻿#region copyright
//<copyright>
// Copyright(C) 2012 TrackerRealm Corporation
// This file is part of the open source project - Jazz. http://jazz.codeplex.com
// 
// Jazz is open software: you can redistribute it and/or modify it 
// under the terms of the GNU Affero General Public License (AGPL) as published by 
// the Free Software Foundation, version 3 of the License.
// 
// Jazz is distributed in the hope that it will be useful, 
// but WITHOUT ANY WARRANTY; without even the implied warranty 
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
//  See the GNU Affero General Public License (AGPL) for more details.
// 
// You should have received a copy of the GNU General Public 
// License along with Jazz.  If not, see <http://www.gnu.org/licenses/>.
//
// REMOVAL OF THIS NOTICE IS VIOLATION OF THE COPYRIGHT. 
//</copyright>
#endregion
using System;
using System.Collections.Generic;
using System.Text;

namespace TrackerRealm.Jazz.Common
{
    /// <summary>
    /// This supports storing Jazz Objects, classes and other objects by an 'ID' or '<see cref="Guid"/>'.
    /// </summary>
    public interface IjStorageUnit
    {
        
        #region ID
        /// <summary>
        /// Gets a Guid value which is used to store and retrieve objects from the nexus.
        /// </summary>
        Guid ID
        {
            get;
        }
        #endregion
        #region StorageType
        /// <summary>
        /// Gets the Nexus storage type giving information about what is stored.
        /// Examples are 'Array', 'String', 'CompositeObject', 'ParseUnit', etc.
        /// </summary>
        jStorageType StorageType
        {
            get;
        }
        #endregion
        #region NexusStatusType
        /// <summary>
        /// The status of Nexus objects.  
        /// Objects can be Valid, Deleted, Disconnected or Superceeded.
        /// This property is safe to be accessed by GUI/Application code or 'Client Thread' code.
        /// </summary>
        jLifeCycleType Status
        {
            get;
        }
        #endregion
        #region StorageStatus
        /// <summary>
        /// Indicates whether an object's data is pending or confirmed.
        /// 'Pending' would indicate that an object has been changed but the server
        /// nexus has not yet 'Confirmed' the operation.
        /// This property is safe to be accessed by GUI/Application code or 'Client Thread' code.
        /// </summary>
        jStorageStatusType StorageStatus
        {
            get;
        }
        #endregion
        #region Timestamp
        /// <summary>
        /// Returns the timeStamp that was issued by server nexus.
        /// When blank the object has been created but not written for the first time.
        /// The time stamp is only valid if '<see cref="StorageStatus"/>' is 'Confirmed'.
        /// Time stamps are unique for each write operation that occurs in a single server nexus.
        /// This property is safe to be accessed by GUI/Application code or 'Client Thread' code.
        /// </summary>
        jTimestamp Timestamp
        {
            get;
        }
        #endregion
        #region Name
        /// <summary>
        /// Returns a name of the object.
        /// May return a blank string "".
        /// Once an object has Name it may not be changed.
        /// </summary>
        string Name
        {
            get;
        }
        #endregion
        #region NameFull
        /// <summary>
        /// Returns the full name of the object.
        /// May return a blank string "" for certain objects.
        /// Primarily used for error messages.
        /// </summary>
        string FullName
        {
            get;
        }
        #endregion


    }
}
